package b.g.b.h.l;

import b.g.b.h.c;
import b.g.b.h.d;

/* compiled from: WidgetRun */
public abstract class o implements d {
    public int a;
    public d b;
    public l c;
    public b.g.b.h.d.a d;
    public g e = new g(this);
    public int f = 0;
    public boolean g = false;
    public f h = new f(this);
    public f i = new f(this);
    public a j = a.NONE;

    /* compiled from: WidgetRun */
    public enum a {
        NONE,
        START,
        END,
        CENTER
    }

    public o(d dVar) {
        this.b = dVar;
    }

    public void a(d dVar) {
    }

    public final void b(f fVar, f fVar2, int i) {
        fVar.l.add(fVar2);
        fVar.f = i;
        fVar2.k.add(fVar);
    }

    public final void c(f fVar, f fVar2, int i, g gVar) {
        fVar.l.add(fVar2);
        fVar.l.add(this.e);
        fVar.h = i;
        fVar.i = gVar;
        fVar2.k.add(fVar);
        gVar.k.add(fVar);
    }

    public abstract void d();

    public abstract void e();

    public abstract void f();

    public final int g(int i, int i2) {
        d dVar;
        int i3;
        if (i2 == 0) {
            dVar = this.b;
            i3 = dVar.p;
            i2 = Math.max(dVar.o, i);
            if (i3 > 0) {
                i2 = Math.min(i3, i);
            }
            if (i2 == i) {
                return i;
            }
        }
        dVar = this.b;
        i3 = dVar.s;
        i2 = Math.max(dVar.r, i);
        if (i3 > 0) {
            i2 = Math.min(i3, i);
        }
        if (i2 == i) {
            return i;
        }
        return i2;
    }

    public final f h(c cVar) {
        cVar = cVar.f;
        f fVar = null;
        if (cVar == null) {
            return null;
        }
        d dVar = cVar.d;
        int ordinal = cVar.e.ordinal();
        if (ordinal == 1) {
            fVar = dVar.d.h;
        } else if (ordinal == 2) {
            fVar = dVar.e.h;
        } else if (ordinal == 3) {
            fVar = dVar.d.i;
        } else if (ordinal == 4) {
            fVar = dVar.e.i;
        } else if (ordinal == 5) {
            fVar = dVar.e.k;
        }
        return fVar;
    }

    public final f i(c cVar, int i) {
        cVar = cVar.f;
        f fVar = null;
        if (cVar == null) {
            return null;
        }
        d dVar = cVar.d;
        o oVar = i == 0 ? dVar.d : dVar.e;
        int ordinal = cVar.e.ordinal();
        if (ordinal == 1 || ordinal == 2) {
            fVar = oVar.h;
        } else if (ordinal == 3 || ordinal == 4) {
            fVar = oVar.i;
        }
        return fVar;
    }

    public long j() {
        g gVar = this.e;
        return gVar.j ? (long) gVar.g : 0;
    }

    public abstract boolean k();

    /* JADX WARNING: Missing block: B:23:0x0053, code skipped:
            if (r10.a == 3) goto L_0x00b6;
     */
    public void l(b.g.b.h.c r13, b.g.b.h.c r14, int r15) {
        /*
        r12 = this;
        r0 = r12.h(r13);
        r1 = r12.h(r14);
        r2 = r0.j;
        if (r2 == 0) goto L_0x00f9;
    L_0x000c:
        r2 = r1.j;
        if (r2 != 0) goto L_0x0012;
    L_0x0010:
        goto L_0x00f9;
    L_0x0012:
        r2 = r0.g;
        r13 = r13.d();
        r13 = r13 + r2;
        r2 = r1.g;
        r14 = r14.d();
        r2 = r2 - r14;
        r14 = r2 - r13;
        r3 = r12.e;
        r4 = r3.j;
        r5 = 1056964608; // 0x3f000000 float:0.5 double:5.222099017E-315;
        if (r4 != 0) goto L_0x00b6;
    L_0x002a:
        r4 = r12.d;
        r6 = b.g.b.h.d.a.MATCH_CONSTRAINT;
        if (r4 != r6) goto L_0x00b6;
    L_0x0030:
        r4 = r12.a;
        if (r4 == 0) goto L_0x00af;
    L_0x0034:
        r7 = 1;
        if (r4 == r7) goto L_0x009f;
    L_0x0037:
        r8 = 2;
        if (r4 == r8) goto L_0x0076;
    L_0x003a:
        r8 = 3;
        if (r4 == r8) goto L_0x003f;
    L_0x003d:
        goto L_0x00b6;
    L_0x003f:
        r4 = r12.b;
        r9 = r4.d;
        r10 = r9.d;
        if (r10 != r6) goto L_0x0056;
    L_0x0047:
        r10 = r9.a;
        if (r10 != r8) goto L_0x0056;
    L_0x004b:
        r10 = r4.e;
        r11 = r10.d;
        if (r11 != r6) goto L_0x0056;
    L_0x0051:
        r6 = r10.a;
        if (r6 != r8) goto L_0x0056;
    L_0x0055:
        goto L_0x00b6;
    L_0x0056:
        if (r15 != 0) goto L_0x005a;
    L_0x0058:
        r9 = r4.e;
    L_0x005a:
        r6 = r9.e;
        r8 = r6.j;
        if (r8 == 0) goto L_0x00b6;
    L_0x0060:
        r4 = r4.S;
        if (r15 != r7) goto L_0x006b;
    L_0x0064:
        r6 = r6.g;
        r6 = (float) r6;
        r6 = r6 / r4;
        r6 = r6 + r5;
        r4 = (int) r6;
        goto L_0x0072;
    L_0x006b:
        r6 = r6.g;
        r6 = (float) r6;
        r4 = r4 * r6;
        r4 = r4 + r5;
        r4 = (int) r4;
    L_0x0072:
        r3.c(r4);
        goto L_0x00b6;
    L_0x0076:
        r4 = r12.b;
        r6 = r4.P;
        if (r6 == 0) goto L_0x00b6;
    L_0x007c:
        if (r15 != 0) goto L_0x0081;
    L_0x007e:
        r6 = r6.d;
        goto L_0x0083;
    L_0x0081:
        r6 = r6.e;
    L_0x0083:
        r6 = r6.e;
        r7 = r6.j;
        if (r7 == 0) goto L_0x00b6;
    L_0x0089:
        if (r15 != 0) goto L_0x008e;
    L_0x008b:
        r4 = r4.q;
        goto L_0x0090;
    L_0x008e:
        r4 = r4.t;
    L_0x0090:
        r6 = r6.g;
        r6 = (float) r6;
        r6 = r6 * r4;
        r6 = r6 + r5;
        r4 = (int) r6;
        r4 = r12.g(r4, r15);
        r3.c(r4);
        goto L_0x00b6;
    L_0x009f:
        r3 = r3.m;
        r3 = r12.g(r3, r15);
        r4 = r12.e;
        r3 = java.lang.Math.min(r3, r14);
        r4.c(r3);
        goto L_0x00b6;
    L_0x00af:
        r4 = r12.g(r14, r15);
        r3.c(r4);
    L_0x00b6:
        r3 = r12.e;
        r4 = r3.j;
        if (r4 != 0) goto L_0x00bd;
    L_0x00bc:
        return;
    L_0x00bd:
        r3 = r3.g;
        if (r3 != r14) goto L_0x00cc;
    L_0x00c1:
        r14 = r12.h;
        r14.c(r13);
        r13 = r12.i;
        r13.c(r2);
        return;
    L_0x00cc:
        r14 = r12.b;
        if (r15 != 0) goto L_0x00d3;
    L_0x00d0:
        r14 = r14.Z;
        goto L_0x00d5;
    L_0x00d3:
        r14 = r14.a0;
    L_0x00d5:
        if (r0 != r1) goto L_0x00dd;
    L_0x00d7:
        r13 = r0.g;
        r2 = r1.g;
        r14 = 1056964608; // 0x3f000000 float:0.5 double:5.222099017E-315;
    L_0x00dd:
        r2 = r2 - r13;
        r2 = r2 - r3;
        r15 = r12.h;
        r13 = (float) r13;
        r13 = r13 + r5;
        r0 = (float) r2;
        r0 = r0 * r14;
        r0 = r0 + r13;
        r13 = (int) r0;
        r15.c(r13);
        r13 = r12.i;
        r14 = r12.h;
        r14 = r14.g;
        r15 = r12.e;
        r15 = r15.g;
        r14 = r14 + r15;
        r13.c(r14);
    L_0x00f9:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.g.b.h.l.o.l(b.g.b.h.c, b.g.b.h.c, int):void");
    }
}
